#include <REGX52.H>
#include "Delay.h"

	void UART_Init(void)		//4800bps@11.0592MHz
{
	PCON |= 0x80;		//????????SMOD
	SCON = 0x50;		//8???,?????	
	TMOD &= 0x0F;		//?????1???
	TMOD |= 0x20;		//?????1?8???????
	TL1 = 0xF4;		//??????
	TH1 = 0xF4;		//????????
	ET1 = 0;		//?????1??
	TR1 = 1;		//?????1
}


//void UART_Init(void)		//4800bps@12.000MHz
//{
//	SCON = 0x50;		//8???,?????
//	PCON |=0x80;	//???1???Fosc/12,?12T
//	TMOD &= 0x0F;	
//  TMOD |= 0x20;		//?????1?16???????
//	TL1 = 0xF3;		//??????
//	TH1 = 0xF3;		//??????
//	ET1 = 0;		//?????1??
//	TR1 = 1;		//?????1
//}

void UART_SendByte(unsigned char Byte)
{
	SBUF=Byte;
	while(TI==0){
		TI=0;
	}
}
unsigned char Sec=0;
	void main (){
		UART_Init();
		
		while(1){
			
			UART_SendByte(0x12);
	    //Sec++;
   	Delay(1000);
			
		}
	}
	